import React from 'react'

export default function ComA(props) {
    const { stateA, setStateA, setStateB} = props
    const onButtonClick = () => {
        setStateB(stateA)
    }
    const onResetButtonClick = () => {
        setStateA("A")
    }
  return (
    <div>
      {stateA}
      <button onClick={onButtonClick}>把B变成A</button>
      <button onClick={onResetButtonClick}>还原A</button>
    </div>
  )
}
